{extend name="public/base"}

{block name="x-body"}
<style>
    .layui-form-item .layui-input-inline {
        width: 400px;
    }
</style>
    <div class="x-body">
        <form class="layui-form">
            {if $id}
            <input type="hidden" name="id" value="{$id}">
            {/if}

            <div class="layui-form-item">
                <label for="name" class="layui-form-label">
                    <span class="x-red">*</span>链接名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="name" name="name" required="" lay-verify="required"
                           autocomplete="off" class="layui-input" value="{$result.name}">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>
                </div>
            </div>

            <div class="layui-form-item">
                <label for="url" class="layui-form-label">
                    <span class="x-red">*</span>链接地址
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="url" name="url" required="" lay-verify="required"
                           autocomplete="off" class="layui-input" value="{$result.url}">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>
                </div>
            </div>

            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="edit" lay-submit="" id="L_repass">
                    {$id ? '修改' : '增加'}
                </button>
            </div>
        </form>
    </div>
    <script>
        formData('{:url("MallConfig/friendly_form")}', 'edit', function (){
            window.parent.location.reload();

            var index = parent.layer.getFrameIndex(window.name);
            //关闭当前frame
            parent.layer.close(index);
        }, false);
    </script>
{/block}